﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace deneme
{
    public partial class PersonelForm : Form
    {

        SqlConnection con = new SqlConnection(ClassSqlConnection.ConnectionString);
        ClassShowDataGridView csdgw = new ClassShowDataGridView();
        ClassFillComboBox cfcb = new ClassFillComboBox();

        public PersonelForm()
        {
            InitializeComponent();
        }
        public void gridyenileme()  //datagridimizi refresh etmek için method
        {
            String cmd = "SELECT * FROM dbo.tblVagon";
            csdgw.loadDataGrid(dataGridView1, cmd);

        }
        private void PersonelForm_Load(object sender, EventArgs e)
        {
            dataGridView1.BackgroundColor = this.BackColor;
            gridyenileme();
        }

        private void Anabtn2_Click(object sender, EventArgs e)
        {
            con.Open();
            DialogResult çıkış;
            çıkış = MessageBox.Show("Çıkmak istediğinizden emin misiniz?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (çıkış == DialogResult.Yes)
            {

                con.Close();
                Application.Exit();
            }
        }

        private void Anabtn1_Click(object sender, EventArgs e)
        {
            Anasayfa ana = new Anasayfa();
            ana.Show();
            this.Hide();
        }
    }
}
